/**
    Copyright (c) 2010 yakiimo02
    Distributed under the New BSD License.
    See included license.txt or http://www.yakiimo3d.com/NewBSDLicense.txt
**/

#pragma once

/**
    @brief  Buddhabrot fractals on the CPU.
    @author yakiimo02
    @date    2010/01/24
*/

#include "BuddhabrotBase.h"

class DataBufferDX11;

/**    
    @brief  CPU implemention of the Buddhabrot fractal.
    @author yakiimo02
    @date    2010/01/30
*/
class BuddhabrotCPU : public BuddhabrotBase
{
public:
    BuddhabrotCPU();
    ~BuddhabrotCPU();

    void Create( DataBufferDX11* pDataBuffer );
    void Render( ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, DataBufferDX11* pDataBuffer );
    void Destroy();
    void ClearIterations();

protected:
    int Iterate( float zRe, float zIm ); 
    void IterateAndPlot( float zRe, float zIm, int nWidth, int nHeight, int nIterationEscape );

protected:
    std::vector< UInt4 >    m_iterations;                // buddhabrot plot output buffer
};

